#include <iostream>
#include <vector>
using namespace std;
 
int main()
{
    int n = 0;
    while (cin >> n)
    {
        getchar(); // 接收下该行之后的空格，否则无法获取下一行
        vector<string> arr(n);
        string str;
        for(int i = 0; i < n; ++i)
        {
            getline(cin, str);
            arr[i] = str;
 
            bool flag = true;
            for(auto& e : arr[i])
            {
                if(e == ',' || e == ' ')
                    flag = false;
            }
            if(flag)
                cout << arr[i];
            else 
                cout << "\"" << arr[i] << "\"";
 
            if(i != n - 1)
                cout << ", ";
        }
        cout << endl;
    }
 
    return 0;
}